package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.entity.Address;
import com.yunshang.shoppingmall.mapper.AddressMapper;
import com.yunshang.shoppingmall.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    AddressMapper addressMapper;
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return  addressMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Address record) {
       return  addressMapper.insert(record);
    }

    @Override
    public int insertSelective(Address record) {
       return addressMapper.insertSelective(record);
    }

    @Override
    public Address selectByPrimaryKey(Integer id) {
        return addressMapper.selectByPrimaryKey(id);
    }

    @Override
    public Address selectByUserIdTwo(Integer id) {
        return addressMapper.selectByUserIdTwo(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Address record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Address record) {
        return  addressMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Address> selectAddressAll() {
       return addressMapper.selectAddressAll();
    }

    @Override
    public List<Address> selectDefaultMore(Integer isdefault, Integer userId) {
        return addressMapper.selectDefaultMore(isdefault,userId);
    }

    @Override
    public Address selectById(Integer id) {
        return addressMapper.selectById(id);
    }

    @Override
    public Address selectLogType(Integer id) {
        return addressMapper.selectLogType(id);
    }

    @Override
    public List<Address> selectByUserId(Integer userId) {
        return addressMapper.selectByUserId(userId);
    }

    @Override
    public Address selectDefault(Integer isdefault, Integer userId) {
        return addressMapper.selectDefault(isdefault,userId);
    }

    @Override
    public int updateAddressIsMoreAddressByUserId(int userId) {
        return addressMapper.updateAddressIsMoreAddressByUserId(userId);
    }

    @Override
    public int updateDefaultAddress(int id) {
        return addressMapper.updateDefaultAddress(id);
    }

    @Override
    public int updateAddressStateByUserId(int userId) {
        return addressMapper.updateAddressStateByUserId(userId);
    }

}
